Style Master Pro - CSS2 "WebFonts"

In CSS1, the only way for you to specify a font is by name or family. CSS2 introduces the @font-face rule that enables you to specify a font according to its properties. A browser can then use this specification to choose the closest possible match from the fonts available.

The @font-face rule is a little complicated, so to learn more about it, see the section in our CSS Guide.

Creating an @font-face rule

To create an @font-face rule

1. choose New Statement… from the Statement menu

2. choose @font-face Rule from the pop-up menu in the New Statement dialog.

The @font-face Rule Editor opens.

HTML Element Selector

This is divided into two parts. At the top is the source part of the rule. Here you specify the name of the font to be used if it is available on the client's system, the url of a downloadable font to be used, and the format of font to be expected at the end of the url. These are all optional.

The second part of this window is where you edit the descriptors for the rule. A descriptor is the name of the property of the font that you want to match, and a list of values for this property.

To create a descriptor

1. choose the name of the property for the descriptor in the pop-up menu labeled Edit Descriptors

2. choose or enter the value for the descriptor using the pop-up menu, text field or list that appears when you choose the property in step 1

3. click Add to add this property to the list in the descriptor. If this is the first value for the descriptor, the descriptor will be added to the list of descriptors on the right hand side of the window

To remove a value from a descriptor

1. select the descriptor in the list at the right of the window

2. select the property whose value you want to remove in the pop-up menu labeled Edit Descriptors

3. select the value you want to remove from this descriptor

4. click Remove

To remove a descriptor entirely

1. select the descriptor in the list of descriptors on the right of the window

2. click Remove Descriptor

Next

In this chapter we learnt how to create @font-face rules using Style Master Pro. Next we take a look at previewing your style sheet.

welcome about style master creating style sheets selectors properties media printing font faces previewing linking

home